<!DOCTYPE html>
<html lang="en">

<head>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="">
  <meta name="author" content="">

  <title>基于天猫药品的人工智能虚假评论鉴别系统</title>
	
  
  <!-- Custom fonts for this template-->
  <link href="../static/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
  <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">
  

  <!-- Custom styles for this template-->
  <link href="../static/css/sb-admin-2.min.css" rel="stylesheet">
  
</head>

<body id="page-top">

  <!-- Page Wrapper -->
  <div id="wrapper">

    <!-- Sidebar -->
    <ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">

      <!-- Sidebar - Brand -->
      <a class="sidebar-brand d-flex align-items-center justify-content-center" href="(( url_for('index') ))">
        <div class="sidebar-brand-icon rotate-n-15">
          <i class="fas fa-plus-square"></i>
        </div>
        <div class="sidebar-brand-text mx-3">人工智能药品虚假评论鉴别系统</div>
      </a>

      <!-- Divider -->
      <hr class="sidebar-divider my-0">

      <!-- Nav Item - Dashboard -->
      <li class="nav-item ">
        <a class="nav-link" href="(( url_for('index') ))">
          <i class="fas fa-fw fa-info-circle"></i>
          <span>药品信息</span></a>
      </li>

      <!-- Divider -->
      <hr class="sidebar-divider">

      <!-- Nav Item - Dashboard -->
      <li class="nav-item ">
        <a class="nav-link" href="(( url_for('tables') ))">
          <i class="fas fa-fw fa-table"></i>
          <span>买家评价</span></a>
      </li>

      <!-- Divider -->
      <hr class="sidebar-divider">

      <!-- Nav Item - Dashboard -->
      <li class="nav-item active">
        <a class="nav-link" href="(( url_for('charts') ))">
          <i class="fas fa-fw fa-chart-area"></i>
          <span>结果分析</span></a>
      </li>

      <!-- Divider -->
      <hr class="sidebar-divider">

      <!-- Nav Item - Dashboard -->
      <li class="nav-item ">
        <a class="nav-link" href="(( url_for('store') ))">
          <i class="fas fa-fw fa-flag"></i>
          <span>店铺信用</span></a>
      </li>

      <!-- Divider -->
      <hr class="sidebar-divider d-none d-md-block">

      <!-- Sidebar Toggler (Sidebar) -->
      <div class="text-center d-none d-md-inline">
        <button class="rounded-circle border-0" id="sidebarToggle"></button>
      </div>

    </ul>
    <!-- End of Sidebar -->

    <!-- Content Wrapper -->
    <div id="content-wrapper" class="d-flex flex-column">

      <!-- Main Content -->
      <div id="content">

        <!-- Topbar -->
        <nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">

          <!-- Sidebar Toggle (Topbar) -->
          <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
            <i class="fa fa-bars"></i>
          </button>

          <!-- Topbar Search -->
          <form class="d-none d-sm-inline-block form-inline mr-auto ml-md-3 my-2 my-md-0 mw-100 navbar-search" method="POST">
            <div class="input-group">
              <input type="text" name="geturl" class="form-control bg-light border-0 small" placeholder="请输入所查询药品URL..." aria-label="Search" aria-describedby="basic-addon2">
              <div class="input-group-append">
                <button class="btn btn-primary" type="submit">
                  <i class="fas fa-search fa-sm"></i>
                </button>
              </div>
            </div>
          </form>

          <!-- Topbar Navbar -->
          <ul class="navbar-nav ml-auto">

            <!-- Nav Item - Search Dropdown (Visible Only XS) -->
            <li class="nav-item dropdown no-arrow d-sm-none">
              <a class="nav-link dropdown-toggle" href="#" id="searchDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <i class="fas fa-search fa-fw"></i>
              </a>
              <!-- Dropdown - Messages -->
              <div class="dropdown-menu dropdown-menu-right p-3 shadow animated--grow-in" aria-labelledby="searchDropdown">
                <form class="form-inline mr-auto w-100 navbar-search" method="POST">
                  <div class="input-group">
                    <input type="text" name="geturl" class="form-control bg-light border-0 small" placeholder="请输入所查询药品URL..." aria-label="Search" aria-describedby="basic-addon2">
                    <div class="input-group-append">
                      <button class="btn btn-primary" type="submit">
                        <i class="fas fa-search fa-sm"></i>
                      </button>
                    </div>
                  </div>
                </form>
              </div>
            </li>

          </ul>

        </nav>
        <!-- End of Topbar -->

        <!-- Begin Page Content -->
        <div class="container-fluid">

          <!-- Page Heading -->
          <div class="d-sm-flex align-items-center justify-content-between mb-4">
            <h1 class="h3 mb-0 text-gray-800">结果分析</h1>
            <!-- <a href="#" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Generate Report</a> -->
          </div>

          <!-- Content Row -->

          <div class="row">

            <div class="col-xl-8 col-lg-7">
              <!-- Project Card Example -->
              <div class="card shadow mb-4">
                <div class="card-header py-3">
                  <h6 class="m-0 font-weight-bold text-primary">评论类型</h6>
                </div>
                <div class="card-body">
                  <h4 class="small font-weight-bold">好评 &nbsp;（&nbsp;((amount[0]))条&nbsp;）<span class="float-right">((percent[0]))%</span></h4>
                  <div class="progress mb-4">
                    
                    <div id="percent1" class="progress-bar bg-danger" role="progressbar"  aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"></div>
                  </div>
                  <br>
                  <h4 class="small font-weight-bold">中评 &nbsp;（&nbsp;((amount[1]))条&nbsp;）<span class="float-right">((percent[1]))%</span></h4>
                  <div class="progress mb-4">
                    <div id="percent2" class="progress-bar bg-warning" role="progressbar"  aria-valuenow="40" aria-valuemin="0" aria-valuemax="100"></div>
                  </div>
                  <br>
                  <h4 class="small font-weight-bold">差评 &nbsp;（&nbsp;((amount[2]))条&nbsp;）<span class="float-right">((percent[2]))%</span></h4>
                  <div class="progress mb-4">
                    <div id="percent3" class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"></div>
                  </div>
                </div>
              </div>
            </div>

            <!-- Pie Chart -->
            <div class="col-xl-4 col-lg-5">
              <div class="card shadow mb-4">
                <!-- Card Header - Dropdown -->
                <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
                  <h6 class="m-0 font-weight-bold text-primary">评论可信度</h6>
                </div>
                <!-- Card Body -->
                <div class="card-body_">
                  <div class="chart-pie pt-4 pb-2">
                    <canvas id="myPieChart"></canvas>                    
                  </div>
                  <div class="mt-4 text-center small">
                    <span class="mr-2">
                      <i class="fas fa-circle" style="color: #1cc88a;"></i> 评论可信概率
                    </span>&nbsp;&nbsp;
                    <span class="mr-2">
                      <i class="fas fa-circle" style="color: #d1d3e2;"></i> 评论不可信概率
                    </span>
                    <!-- <span class="mr-2">
                      <i class="fas fa-circle text-info"></i> Referral
                    </span> -->
                  </div>
                </div>
              </div>
            </div>
          </div>

          <div class="row">

            <div class="col-xl-12 col-lg-11">
              <!-- Project Card Example -->
              <div class="card shadow mb-4">
                <div class="card-header py-3">
                  <h6 class="m-0 font-weight-bold text-primary">商品信用</h6>
                </div>
                <div class="card-body">
                  <table>
                    <tbody>
                      <tr>
                        <th width="150rem" height="60rem">商品信用等级</th>
                        <td>
                          {% if possibility[0] == -1 %}
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;优&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;良&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;中&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;差 
                          {% elif possibility[0] >= 60 %}
                          <i class="fas fa-circle" style="color: #1cc88a;"></i>&nbsp;&nbsp;优&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;良&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;中&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;差 
                          {% elif possibility[0] < 60 and possibility[0] >= 50 %}
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;优&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle" style="color: #4e73df"></i>&nbsp;&nbsp;良&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;中&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;差
                          {% elif possibility[0] < 50 and possibility[0] >= 40 %}
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;优&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;良&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle" style="color: #f6c23e"></i>&nbsp;&nbsp;中&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;差 
                          {% else %}
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;优&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;良&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;中&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle" style="color: #e74a3b"></i>&nbsp;&nbsp;差 
                          {% endif %}
                        </td>
                      </tr>
                      <tr>
                        <th>是否被恶意差评</th>
                        <td>
                          {% if binary == 1 %}
                          <i class="fas fa-circle" style="color: #e74a3b"></i>&nbsp;&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;否
                          {% elif binary == 0 %}
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle"  style="color: #1cc88a;"></i>&nbsp;&nbsp;否
                          {% else %}
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <i class="fas fa-circle"></i>&nbsp;&nbsp;否
                          {% endif %}
                        </td>
                      </tr>
                    </tbody>
                  </table>
                </div>
              </div>
            </div>
          </div>

          <div class="row">

            <div class="col-xl-12 col-lg-11">
              <!-- Project Card Example -->
              <div class="card shadow mb-4">
                <div class="card-header py-3">
                  <h6 class="m-0 font-weight-bold text-primary">词云可视化</h6>
                </div>
                <div class="card-body">
                  {% if key %}
                  <img src="(( url_for('static', filename='img/output5-village.png') ))" alt="" width="100%">
                  {% endif %}
                </div>
              </div>
            </div>
          </div>

          

        </div>
        <!-- /.container-fluid -->

      </div>
      <!-- End of Main Content -->

      <!-- Footer -->
      <footer class="sticky-footer bg-white">
        <div class="container my-auto">
          <div class="copyright text-center my-auto">
            <span>&copy; 人工智能药品虚假评论鉴别系统</span>
          </div>
        </div>
      </footer>
      <!-- End of Footer -->

    </div>
    <!-- End of Content Wrapper -->

  </div>
  <!-- End of Page Wrapper -->

  <!-- Scroll to Top Button-->
  <a class="scroll-to-top rounded" href="#page-top">
    <i class="fas fa-angle-up"></i>
  </a>


  <!-- Bootstrap core JavaScript-->
  <script src="(( url_for('static', filename='vendor/jquery/jquery.min.js') ))"></script>
  <script src="(( url_for('static', filename='vendor/bootstrap/js/bootstrap.bundle.min.js') ))"></script>

  <!-- Core plugin JavaScript-->
  <script src="(( url_for('static', filename='vendor/jquery-easing/jquery.easing.min.js') ))"></script>

  <!-- Custom scripts for all pages-->
  <script src="(( url_for('static', filename='js/sb-admin-2.min.js') ))"></script>

  <!-- Page level plugins -->
  <script src="(( url_for('static', filename='vendor/chart.js/Chart.min.js') ))"></script>

  <!-- Page level custom scripts -->
  <script src="(( url_for('static', filename='js/demo/chart-area-demo.js') ))"></script>
  
  
</body>

</html>

<script>
  var per1=document.getElementById("percent1");
  per1.style.width=((percent[0])) + '%';
  var per2=document.getElementById("percent2");
  per2.style.width=((percent[1])) + '%';
  var per3=document.getElementById("percent3");
  per3.style.width=((percent[2])) + '%';
</script>

<script>
// Set new default font family and font color to mimic Bootstrap's default styling
Chart.defaults.global.defaultFontFamily = 'Nunito', '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
Chart.defaults.global.defaultFontColor = '#858796';

// Pie Chart Example
var ctx = document.getElementById("myPieChart");
var myPieChart = new Chart(ctx, {
  type: 'doughnut',
  data: {
    labels: ["评论可信概率（%）", "评论不可信概率（%）"],
    datasets: [{
      data : ((possibility)),
      backgroundColor: ['#1cc88a', '#d1d3e2'],
      hoverBackgroundColor: ['mediumseagreen', '#b7b9cc'],
      hoverBorderColor: "rgba(234, 236, 244, 1)",
    }],
  },
  options: {
    maintainAspectRatio: false,
    tooltips: {
      backgroundColor: "rgb(255,255,255)",
      bodyFontColor: "#858796",
      borderColor: '#dddfeb',
      borderWidth: 1,
      xPadding: 15,
      yPadding: 15,
      displayColors: false,
      caretPadding: 10,
    },
    legend: {
      display: false
    },
    cutoutPercentage: 80,
  },
});
</script>

